home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch01 / textfont.c < prev    next >
Text File  |  1993-12-06  |  1KB  |  44 lines

  1. /**
  2.  ** TEXTFONT.C ---- hacked text modes with 14 and 8 row fonts
  3.  **
  4.  ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  5.  ** Copyright (C) 1992 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
  6.  ** Copyright (C) 1993 Grzegorz Mazur, gbm@ii.pw.edu.pl
  7.  **
  8.  ** This file is distributed under the terms listed in the document
  9.  ** "copying.dj", available from DJ Delorie at the address above.
  10.  ** A copy of "copying.dj" should accompany this file; if not, a copy
  11.  ** should be available from where this file was obtained.  This file
  12.  ** may not be distributed without a verbatim copy of "copying.dj".
  13.  **
  14.  ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  15.  ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16.  **/
  17.  
  18. int set_custom_text_mode(GrModeEntry *md,int noclear,int AXval)
  19. {
  20.     int mode = md->mode.vdr.BIOS_mode;
  21. #ifdef VESA_FUNC
  22.     if(mode >= 0x100) {
  23.         _BX = mode | (noclear ? 0x8000 : 0);
  24.         _AX = VESA_FUNC + VESA_SET_MODE;
  25.         geninterrupt(0x10);
  26.         if(_AX != VESA_SUCCESS) return(-1);
  27.     }
  28.     else {
  29. #endif
  30.         _AX = mode | (noclear ? 0x80 : 0);
  31.         geninterrupt(0x10);
  32. #ifdef VESA_FUNC
  33.     }
  34. #endif
  35.     _AX = AXval;            /* load BIOS font */
  36.     _BX = 0;
  37.     geninterrupt(0x10);
  38.     return(HDR->driver_flags);
  39. }
  40.  
  41. #define mode_set_8x14_font(MD,CLF)    set_custom_text_mode(MD,CLF,0x1111)
  42. #define mode_set_8x8_font(MD,CLF)    set_custom_text_mode(MD,CLF,0x1112)
  43.  
  44.